home *** CD-ROM | disk | FTP | other *** search
/ FM Towns: Free Software Collection 9 / FM Towns Free Software Collection 9.iso / t_os / shell / igo / gosource / mddesk.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-16  |  2.8 KB  |  123 lines

  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. #include <winb.h>
  5. #include <te.h>
  6. #include <fntb.h>
  7. #include <gui.h>
  8. #include "igo.h"
  9. #include "banx.h"
  10. #include "kiffile.h"
  11. #include "title.h"
  12.  
  13. /*    使用する部品の宣言        */
  14. extern int    fsavedialogId;
  15. extern int    fsave_messageId[2];
  16.  
  17. /*    About画面の変数の定義                */
  18.  
  19. int    alertId = -1 ;
  20. int    aboutMesId[2] = -1 ;
  21. int    aboutBtnId = -1 ;
  22.  
  23. /*    背景画面の変数の定義    */
  24.  
  25. int    note_windowId = -1 ;
  26. int    deskTopId = -1 ;
  27. int    deskTopBtnId[2] = -1 ;
  28. int    menuBarId = -1 ;
  29. int    mitemBarId[4] = -1 ;
  30. int    menu0Id = -1 ;
  31. int    mitem0Id = -1 ;
  32. int    menu1Id = -1 ;
  33. int    mitem1Id[7] = -1 ;
  34. int    menu2Id = -1 ;
  35. int    mitem2Id[17] = -1 ;
  36. int    menu3Id = -1 ;
  37. int    title_messageId[15] = -1 ;
  38. int    textcommentId[10] = -1 ;
  39. int about_messageId = -1 ;
  40.  
  41. /*    initDataMIDESK:mitem0Id:MJ_MITEML40の呼び出し関数    */
  42. /*    Aboutを表示するための関数                            */
  43. int    showAboutFunc(kobj, messId, argc, pev, trigger)
  44. int        kobj ;
  45. int        messId ;
  46. int        argc ;
  47. EVENT    *pev ;
  48. int        trigger ;
  49. {
  50. int physicalMax;
  51. int    logicalMax;
  52. int    maxMemory;
  53. static char string[80];
  54.  
  55.     physicalMax = TL_checkMemory(0);
  56.     logicalMax = TL_checkMemory(2);
  57.     maxMemory = (( physicalMax <logicalMax ) ? physicalMax : logicalMax )*4;
  58.  
  59.     sprintf( string, "残りメモリは%5dKバイトです", maxMemory );
  60.     MMI_SendMessage( about_messageId , MM_SETMSG , 1, string);
  61.  
  62.     /*    オブジェクトをダイアログに取り付ける    */
  63.     MMI_SendMessage( alertId , MM_ATTACH , 1 , deskTopId ) ;
  64.  
  65.     /*    alertIdで示されるオブジェクトを表示する    */
  66.     MMI_SendMessage( alertId , MM_SHOW , 0 ) ; 
  67.  
  68.     return NOERR ;
  69. }
  70.  
  71. /*    initDataMIABOU:aboutBtnId:MJ_DBUTTONL40の呼び出し関数    */
  72. /*    Aboutを消去するための関数                                */
  73. int    eraseAboutFunc(kobj, messId, argc, pev, trigger)
  74. int        kobj ;
  75. int        messId ;
  76. int        argc ;
  77. EVENT    *pev ;
  78. int        trigger ;
  79. {
  80.     /*    alertIdで示されるオブジェクトを消す        */
  81.     MMI_SendMessage( alertId , MM_ERASE , 0 ) ;
  82.  
  83.     /*    オブジェクトをダイアログから取り外す    */
  84.     MMI_SendMessage( alertId , MM_DETACH , 0 ) ;
  85.  
  86.     return NOERR ;
  87. }
  88.  
  89. /*    initDataMIDESK:deskTopBtnId[1]:MJ_ICONL40の呼び出し関数    */
  90. /*    initDataMIDESK:mitem1Id[4]:MJ_MITEML40の呼び出し関数    */
  91. int    exitFunc(kobj, messId, argc, pev, trigger)
  92. int        kobj ;
  93. int        messId ;
  94. int        argc ;
  95. EVENT    *pev ;
  96. int        trigger ;
  97. {
  98.     extern int exitFuncRet;
  99.  
  100.     if(title_fsave_read()==ON){
  101.         title_state_set(QUIT);
  102.  
  103.         MMI_SendMessage( fsave_messageId[0], MM_SETMSG, 1, 
  104.                     "棋譜デ-タが保存されておりません");
  105.         MMI_SendMessage( fsave_messageId[1], MM_SETMSG, 1, 
  106.                     "デ-タを保存して終了を行いますか");
  107.  
  108.         /*    オブジェクトをダイアログに取り付ける    */
  109.         MMI_SendMessage( fsavedialogId , MM_ATTACH , 1 , deskTopId ) ;
  110.  
  111.         /*    dialogId_handyでされるオブジェクトを表示する    */
  112.         MMI_SendMessage( fsavedialogId , MM_SHOW , 0 ) ; 
  113.  
  114.     }else{
  115.         kifu_end();
  116.         MMI_SetHaltFlag( TRUE ) ;
  117.         exitFuncRet = NOERR;
  118.     }
  119.  
  120.     return NOERR ;
  121. }
  122.  
  123.